package com.education.wisdom.service.impl;

import com.education.common.utils.Convert;
import com.education.wisdom.mapper.MessageMapper;
import com.education.wisdom.pojo.Message;
import com.education.wisdom.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 * 消息列表 服务层实现
 *
 * @author d
 * @date 2020-07-22 09:11:39
 */
@Service
public class MessageServiceImpl implements MessageService {

    @Autowired
    private MessageMapper messageMapper;

    @Override
    public void deleteByDate(String time) {
        messageMapper.deleteByDate(time);
    }

    //查询消息列表信息
    @Override
    public Message selectMessageById(Integer id) {
        return messageMapper.selectMessageById(id);
    }

    // 查询消息列表列表
    @Override
    public List<Message> selectMessageList(Message message) {
        return messageMapper.selectMessageList(message);
    }

    // 新增消息列表
    @Override
    public int insertMessage(Message message) {
        return messageMapper.insertMessage(message);
    }

    //修改消息列表
    @Override
    public int updateMessage(Message message) {
        return messageMapper.updateMessage(message);
    }

    //删除消息列表对象
    @Override
    public int deleteMessageByIds(String ids) {
        return messageMapper.deleteMessageByIds(Convert.toStrArray(ids));
    }

    @Override
    public Integer selectCount(String userId) {
        return messageMapper.selectCount(userId);
    }
}